#第一遍
# 导入模块
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# 打开浏览器
time.sleep(2)
driver = webdriver.Chrome()
# 输入网址
time.sleep(2)
driver.get('https://www.baidu.com')
# 获取搜索框,输入天气预报
kw = driver.find_element(By.ID,'kw')
time.sleep(2)
kw.send_keys('天气预报')
#点击搜索
time.sleep(2)
su = driver.find_element(By.ID,'su')
su.click()
time.sleep(2)
driver.quit()

#第二遍
# 导入模块
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# 打开浏览器
time.sleep(2)
driver = webdriver.Chrome()
# 输入网址
time.sleep(2)
driver.get('https://www.baidu.com')
# 获取搜索框,输入天气预报
kw = driver.find_element(By.ID,'kw')
time.sleep(2)
kw.send_keys('天气预报')
#点击搜索
time.sleep(2)
su = driver.find_element(By.ID,'su')
su.click()
time.sleep(2)
driver.quit()

